<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.empo.main2_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('empoid')">
                <el-table-column show-overflow-tooltip :prop="'empoid'" :label="$t('entities.empo.main2_grid.columns.empoid')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.empoid')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.empoid}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('pdate')">
                <el-table-column show-overflow-tooltip :prop="'pdate'" :label="$t('entities.empo.main2_grid.columns.pdate')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.pdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.pdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('labservicename')">
                <el-table-column show-overflow-tooltip :prop="'labservicename'" :label="$t('entities.empo.main2_grid.columns.labservicename')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.labservicename')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emservice' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emservice-tab-exp-view', height: 0,width: 0,title: $t('entities.emservice.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="labserviceid">
                            <span>{{row.labservicename}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rempname')">
                <el-table-column show-overflow-tooltip :prop="'rempname'" :label="$t('entities.empo.main2_grid.columns.rempname')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.rempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.rempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('eadate')">
                <el-table-column show-overflow-tooltip :prop="'eadate'" :label="$t('entities.empo.main2_grid.columns.eadate')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.eadate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.eadate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('postate')">
                <el-table-column show-overflow-tooltip :prop="'postate'" :label="$t('entities.empo.main2_grid.columns.postate')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.postate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.postate" tag='EMPOSTATE' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wfstep')">
                <el-table-column show-overflow-tooltip :prop="'wfstep'" :label="$t('entities.empo.main2_grid.columns.wfstep')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.wfstep')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.wfstep" tag='EMPOWFSTEP' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('tsfee')">
                <el-table-column show-overflow-tooltip :prop="'tsfee'" :label="$t('entities.empo.main2_grid.columns.tsfee')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.tsfee')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.tsfee"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taxfee')">
                <el-table-column show-overflow-tooltip :prop="'taxfee'" :label="$t('entities.empo.main2_grid.columns.taxfee')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.taxfee')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.taxfee"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('poamount')">
                <el-table-column show-overflow-tooltip :prop="'poamount'" :label="$t('entities.empo.main2_grid.columns.poamount')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.poamount')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.poamount"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('payway')">
                <el-table-column show-overflow-tooltip :prop="'payway'" :label="$t('entities.empo.main2_grid.columns.payway')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.payway')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.payway" tag='EMPAYWAY' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('civo')">
                <el-table-column show-overflow-tooltip :prop="'civo'" :label="$t('entities.empo.main2_grid.columns.civo')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.civo')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.civo}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('tsivo')">
                <el-table-column show-overflow-tooltip :prop="'tsivo'" :label="$t('entities.empo.main2_grid.columns.tsivo')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.tsivo')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.tsivo}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('taxivo')">
                <el-table-column show-overflow-tooltip :prop="'taxivo'" :label="$t('entities.empo.main2_grid.columns.taxivo')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.taxivo')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.taxivo}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('apprempname')">
                <el-table-column show-overflow-tooltip :prop="'apprempname'" :label="$t('entities.empo.main2_grid.columns.apprempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.apprempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.apprempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('apprdate')">
                <el-table-column show-overflow-tooltip :prop="'apprdate'" :label="$t('entities.empo.main2_grid.columns.apprdate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.apprdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.apprdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('labservicedesc')">
                <el-table-column show-overflow-tooltip :prop="'labservicedesc'" :label="$t('entities.empo.main2_grid.columns.labservicedesc')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empo.main2_grid.columns.labservicedesc')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.labservicedesc}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>